# $Id: PKGBUILD 178421 2013-02-21 20:49:20Z guillaume $
# Maintainer: Guillaume ALAUX <guillaume@archlinux.org>
# Contributor: Kevin Piche <kevin@archlinux.org>
# Contributor: Aaron Griffin <aaron@archlinux.org>
# Contributor: dorphell <dorphell@archlinux.org>

pkgname=easytag
pkgver=2.1.8
pkgrel=2
pkgdesc='Utility for viewing and editing tags for most audio formats'
arch=('i686' 'x86_64')
license=('GPL')
url='http://easytag.sourceforge.net/'
makedepends=('intltool')
depends=('id3lib' 'libid3tag' 'gtk2' 'libvorbis' 'flac' 'speex' 'wavpack' 'taglib'
         'desktop-file-utils' 'hicolor-icon-theme')
install=${pkgname}.install
source=(http://download.gnome.org/sources/${pkgname}/${pkgver:0:3}/${pkgname}-${pkgver}.tar.xz
        easytag-2.1.8-fix_mixed_declarations_and_code.patch
        easytag-2.1.8-fix_mime_directory_association.patch)
sha256sums=('1a2f75c9a70aeb7a404dfaa96e0df0eaaa325df301c58f0f708d0da4c08e65a9'
            '453d2a102cf482d6d1586b11e531bf267f302aab3ee6b8c43b6bcc61cfa2ede5'
            '693da67f0c96d51ad363bb9e70a22b402bc7c5058d648981919a115381700cd3')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  # Already fixed upstream
  # http://git.gnome.org/browse/easytag/commit/src/wavpack_tag.c?id=17a33964c32035f6b9986e13726ae3582a126244
  patch -p0 -i ${srcdir}/easytag-2.1.8-fix_mixed_declarations_and_code.patch

  # Bad Easytag! Bad! You don't know your place!
  patch -p0 -i ${srcdir}/easytag-2.1.8-fix_mime_directory_association.patch

  ./configure --prefix=/usr
  make
}

check() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make -k check
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install
}
